package UI;

import connection.Connection;
import connection.ConnectionSystem;

import javax.swing.*;
import java.awt.*;

/**
 * This is a main Panel.
 * @author Anna
 */
class Surface extends JPanel{
    static JTextField fileNameTextField, versionTextField;
    static JLabel errLabel = new JLabel("");
    static JTextArea textArea = new JTextArea();
    MenuBar mb;
    FileMenu menu;
    static Connection connect=new ConnectionSystem();//Here the Connection should be initialized.
    public Surface(JFrame frame){
        super();

        setBackground(new Color(242,225,235));
        setLayout(new BorderLayout());
        setFocusable(true);

        add(errLabel, BorderLayout.CENTER);

        //
        JPanel textFieldPanel = new JPanel();
        textFieldPanel.setLayout(new FlowLayout());
        fileNameTextField = new JTextField("enter the file name");
        versionTextField = new JTextField("enter the version");
        textFieldPanel.add(fileNameTextField);
        textFieldPanel.add(versionTextField);
        add(textFieldPanel, BorderLayout.SOUTH);
        textArea.setBackground(new Color(242,225,235));
        add(textArea, BorderLayout.CENTER);

        // menu
        mb = new MenuBar();
        menu = new FileMenu();
        mb.add(menu);
        frame.setMenuBar(mb);
    }
}

